//
//  EntAddressBookContact.m
//  mcrmSAAS
//
//  Created by zhaiqiuqiu on 16/10/23.
//  Copyright © 2016年 com.rs. All rights reserved.
//

#import "EntAddressBookContact.h"

@implementation EntAddressBookContact

-(NSString*)pinyinValue
{
    //TODO
    return @"";
}

-(NSString*)nameValue
{
    return self.userName;
}

@end

@implementation DeptInfo

static XMSQueueDictionary *s_jsonPair_dept;
static XMSQueueDictionary *s_tablePair_dept;

+ (void)initialize
{
    if(s_jsonPair_dept == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"DeptID" value:@"deptID"];
        [qd addKey:@"FullID" value:@"fullID"];
        [qd addKey:@"ParentID" value:@"parentID"];
        [qd addKey:@"DeptName" value:@"deptName"];
        [qd addKey:@"Description" value:@"remark"];
        [qd addKey:@"CreateDate" value:@"createDate"];
        [qd addKey:@"ContactPerson" value:@"contactPerson"];
        [qd addKey:@"Tel" value:@"tel"];
        [qd addKey:@"Address" value:@"address"];
        [qd addKey:@"ImageSrc" value:@"imageSrc"];
        [qd addKey:@"Level" value:@"level"];
        
        s_jsonPair_dept = [CTransformHTTPRESTObj registerJSONObjectClass:[DeptInfo class] JSONKeyPair:qd];
    }
    
    if(s_tablePair_dept == nil)
    {
        XMSQueueDictionary *qd = [[XMSQueueDictionary alloc]initWithStoreClass:[CDBColPropertyPair class]];
        [qd addKey:@"deptID" value:@"deptid"];
        [qd addKey:@"fullID" value:@"fullid"];
        [qd addKey:@"parentID" value:@"parentid"];
        [qd addKey:@"deptName" value:@"deptname"];
        [qd addKey:@"remark" value:@"remark"];
        [qd addKey:@"createDate" value:@"createdate"];
        [qd addKey:@"contactPerson" value:@"contactperson"];
        [qd addKey:@"tel" value:@"tel"];
        [qd addKey:@"address" value:@"address"];
        [qd addKey:@"imageSrc" value:@"imagesrc"];
        [qd addKey:@"level" value:@"level"];
        
        s_tablePair_dept = [XMSSQLiteDBTable registerTableClass:[DeptInfo class] cloumnPropertyPair:qd];
    }
}

+ (XMSQueueDictionary *)JSONObjectProperty:(NSArray *)JSONKeys
{
    return [CTransformHTTPRESTObj JSONObjectMap:s_jsonPair_dept propertyWithJSONKey:JSONKeys];
}

- (XMSQueueDictionary *)tableClassValue:(NSArray *)arCol
{
    return [XMSSQLiteDBTable tableColumnMap:s_tablePair_dept classObj:self valueWithColoumn:arCol];
}

+ (BOOL)verifyTableName:(NSString*)tableName
{
    return [tableName isEqualToString:@"deptinfo"];
}

+ (XMSQueueDictionary *)tableColumnProperty:(NSArray *)arCol
{
    return [XMSSQLiteDBTable tableColumnMap:s_tablePair_dept propertyWithColoumn:arCol];
} 
@end
